package zhh.tangbao.auxiliary.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zhh.tangbao.auxiliary.dto.statistics.LogQueryDto;
import zhh.tangbao.auxiliary.service.DataStatisticsService;
import zhh.tangbao.system.result.Result;

/**
 * <p>
 * 描述
 * </p>
 *
 * @author 粥灰灰
 * <p>2023/4/27</p>
 */

@RestController
@RequestMapping("/api/statistics")
public class DataStatisticsController {

    @Autowired
    private DataStatisticsService service;

    @GetMapping("/logPage")
    public Result logPage(LogQueryDto dto) {
        return Result.success().put(service.logPage(dto));
    }

    @GetMapping("/info/{id}")
    public Result info(@PathVariable("id") Integer id) {
        return Result.success().put(service.getInfo(id));
    }
}
